/* 绘画部分懒加载页面所使用的js
 * @author 王校兵
 * @date 2016-7-20
 * @version 1.0
 */

function paintingDrawingScrollDownJs(scrollLength){
	if (scrollLength >700 && scrollLength < 1300
			&& !drawing_floor_state[0]) {
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2010301",
			toPosition : "2010341"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var html = combinFortyArtist(product);
			$("#drawing_tuijie").html(html);
			
			var ad_html = combineBottomAdTwo(product[40]);
			$("#drawing_tuijie_ad").html(ad_html);
		}, "json");

		drawing_floor_state[0] = true;
	} else if (scrollLength > 1300 && scrollLength < 2000
			&& !drawing_floor_state[1]) {
		//创建右侧标题数组  
		var title = ["国画"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2010401",
			toPosition : "2010412",
			newsToPosition : "2010409"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("1F", title, product, "论坛/", data.news);
			$("#drawing_guohua").html(goods_html);

			//拼接广告区域
			var ad_html = combineBottomAdOne(product[9], product[10], product[11]);
			$("#drawing_guohua_ad").html(ad_html);

		}, "json");

		drawing_floor_state[1] = true;
	} else if (scrollLength > 2000 && scrollLength < 2700
			&& !drawing_floor_state[2]) {
		//创建右侧标题数组  
		var title = ["油画"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2010501",
			toPosition : "2010519",
			newsToPosition : "2010509"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("2F", title, product, "论坛/", data.news);
			$("#drawing_youhua").html(goods_html);
			
			//拼接广告区域
			var ad_html = combinTenArtist(product);
			$("#drawing_youhua_ad").html(ad_html);

		}, "json");

		drawing_floor_state[2] = true;
	}else if (scrollLength > 2700 && scrollLength < 3400
			&& !drawing_floor_state[3]) {
		//创建右侧标题数组  
		var title = ["漆画"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2010601",
			toPosition : "2010612",
			newsToPosition : "2010609"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("3F", title, product, "论坛/", data.news);
			$("#drawing_qihua").html(goods_html);
			
			//拼接广告区域
			var ad_html = combineBottomAdOne(product[9], product[10], product[11]);
			$("#drawing_qihua_ad").html(ad_html);

		}, "json");

		drawing_floor_state[3] = true;
	}else if (scrollLength > 3400 && scrollLength < 4100
			&& !drawing_floor_state[4]) {
		//创建右侧标题数组  
		var title = ["版画"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2010701",
			toPosition : "2010719",
			newsToPosition : "2010709"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("4F", title, product, "论坛/", data.news);
			$("#drawing_banhua").html(goods_html);
			
			//拼接广告区域
			var ad_html = combinTenArtist(product);
			$("#drawing_banhua_ad").html(ad_html);

		}, "json");

		drawing_floor_state[4] = true;
	}else if (scrollLength > 4100 && scrollLength < 4800
			&& !drawing_floor_state[5]) {
		//创建右侧标题数组  
		var title = ["水彩","水粉"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2010801",
			toPosition : "2010810",
			newsToPosition : "2010809"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("5F", title, product, "论坛/", data.news);
			$("#drawing_shuicai").html(goods_html);
			
			//拼接广告区域
			var ad_html = combineBottomAdTwo(product[9]);
			$("#drawing_shuicai_ad").html(ad_html);

		}, "json");

		drawing_floor_state[5] = true;
	}else if (scrollLength > 4800 && scrollLength < 5500
			&& !drawing_floor_state[6]) {
		//创建右侧标题数组  
		var title = ["素描","速写"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2010901",
			toPosition : "2010912",
			newsToPosition : "2010909"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("6F", title, product, "论坛/", data.news);
			$("#drawing_sumiao").html(goods_html);
			
			//拼接广告区域
			var ad_html = combineBottomAdOne(product[9], product[10], product[11]);
			$("#drawing_sumiao_ad").html(ad_html);

		}, "json");

		drawing_floor_state[6] = true;
	}else if (scrollLength > 5500 && scrollLength < 6200
			&& !drawing_floor_state[7]) {
		//创建右侧标题数组  
		var title = ["年画"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2011001",
			toPosition : "2011019",
			newsToPosition : "2011009"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("7F", title, product, "论坛/", data.news);
			$("#drawing_nianhua").html(goods_html);
			
			//拼接广告区域
			var ad_html = combinTenArtist(product);
			$("#drawing_nianhua_ad").html(ad_html);

		}, "json");

		drawing_floor_state[7] = true;
	}else if (scrollLength > 6200 && scrollLength < 6900
			&& !drawing_floor_state[8]) {
		//创建右侧标题数组  
		var title = ["连环画"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2011101",
			toPosition : "2011112",
			newsToPosition : "2011109"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("8F", title, product, "论坛/", data.news);
			$("#drawing_lianhuanhua").html(goods_html);
			
			//拼接广告区域
			var ad_html = combineBottomAdOne(product[9], product[10], product[11]);
			$("#drawing_lianhuanhua_ad").html(ad_html);

		}, "json");

		drawing_floor_state[8] = true;
	}else if (scrollLength > 6900 && scrollLength < 7600
			&& !drawing_floor_state[9]) {
		//创建右侧标题数组  
		var title = ["宣传画"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2011201",
			toPosition : "2011219",
			newsToPosition : "2011209"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("9F", title, product, "论坛/", data.news);
			$("#drawing_xuanchuanhua").html(goods_html);
			
			//拼接广告区域
			var ad_html = combinTenArtist(product);
			$("#drawing_xuanchuanhua_ad").html(ad_html);

		}, "json");

		drawing_floor_state[9] = true;
	}else if (scrollLength > 7600 && scrollLength < 8300
			&& !drawing_floor_state[10]) {
		//创建右侧标题数组  
		var title = ["装饰画"];
		$.post("indexProduct", {
			page : "201",
			fromPosition : "2011301",
			toPosition : "2011312",
			newsToPosition : "2011309"
		}, function(data, status) {
			var product = data.pictureAndProduct;
			//拼接商品区域的html
			var goods_html = combinPaintingGoods("10F", title, product, "论坛/", data.news);
			$("#drawing_zhuangshihua").html(goods_html);
			
			//拼接广告区域
			var ad_html = combineBottomAdOne(product[9], product[10], product[11]);
			$("#drawing_zhuangshihua_ad").html(ad_html);

		}, "json");

		drawing_floor_state[10] = true;
	}
}